<?php  

class Application_Model_UrlUtil  
{  
	private $_request;
	private $_moduleName;
	private $_controllerName;
	private $_actionName;
	private $_isDefaultModule = false;
	
	function __construct($request) {
		$this->_request = $request;
		$this->parseUrl();
	}
	
	private function parseUrl() {
		$this->_moduleName = $this->_request->getModuleName();
		$this->_controllerName = $this->_request->getControllerName(); 
		$this->_actionName = $this->_request->getActionName();
		if ($this->_moduleName = "default") {
			$this->_isDefaultModule = true;
		}
	}
	public  function getModuleUrl() {
		$url="/";
		$this->_isDefaultModule || $url = $url. $this->_moduleName;
		return $url;
        
	}

	public  function getControllerUrl() {
		$url = $this->getModuleUrl();
		$url = $url."/".$this->_controllerName;
        return $url;
	}
	
	public  function getActionUrl() {
        $url = $this->getControllerUrl();
		$url = $url."/".$this->_actionName;
        return $url;
	}
} 